// vue3.0中createStore来创建vuex实例。
import { createStore } from 'vuex'
import global from '@/store/modules/global'
import user from '@/store/modules/user'
import cart from '@/store/modules/cart'
import cate from '@/store/modules/cate'
import createPersisdstate from 'vuex-persistedstate'

// 创建vuex仓库并导出
export default createStore({
  // 全局模块配置
  ...global,
  modules: {
    user,
    cart,
    cate
  },
  plugins: [
    createPersisdstate({
      key: 'erabbit-client-pc-store',
      paths: ['user', 'cart']
    })
  ]
})
